<template>
	<view>
		<!-- 顶部占位 -->
		<view class="placeholder"></view>
		<!-- 自定义导航栏 -->

		<view class="head"></view>
	
		<!-- 占位 -->
		<view class="top">
			<text>财富</text>
			<input type="text" value="" placeholder="搜索相关信息"/>
			<image src="@/static/wealth/4735.png" mode=""></image>
			<image src="@/static/wealth/4736.png" mode=""></image>
		</view>

		<!-- 资产 -->
		<view class="assets">
			<view>
				<text class="ass-first">总资产</text>
				<text>0.00</text>
			</view>
			<view>
				<text class="ass-first">最新收益</text>
				<text>0.00</text>
			</view>
		</view>
		<!-- 导航 -->
		<view class="navigation">
			<view class="navigation-child" v-for="item in navigation" :key="item.id" @tap="go(item.id)">
				<image :src="item.src" mode=""></image>
				<text>{{item.text}}</text>
			</view>
		</view>
		<!-- 行情 -->
		<view class="title"><text>行情</text></view>
		<view class="market">
			<view class="market-child" v-for="item in market" :key="item.id">
				<text class="market-text1">{{item.text}}</text>
				<text class="market-text2">{{item.money}}</text>
				<text class="market-text3">{{item.percentage}}</text>
			</view>
			<view class="market-bottom">
				<view>
					<image src="@/static/wealth/47288.png" mode=""></image>
					<text>新春福利 速领50元红包</text>
				</view>
				<view class="vertical"></view>
				<view>
					<image src="@/static/wealth/47299.png" mode=""></image>
					<text>福利：领1288元红包</text>
				</view>
			</view>
		</view>
		<!-- 轮播图 -->
		<swiper :indicator-dots="true" :autoplay="true" :interval="3000" :duration="1000" :circular="true" class="swiper">
			<swiper-item v-for="item in swiper" :key="item.id">
				<image :src="item.src" mode=""></image>
			</swiper-item>
		</swiper>
		<!-- 基金投顾 -->
		<view class="title"><text>基金投顾</text></view>
		<view class="fund">
			<view class="fund-child" v-for="item in fund" :key="item.id">
				<text class="fund-head">{{item.head}}</text>
				<text class="fund-text1">{{item.text1}}</text>
				<text class="fund-text2">{{item.text2}}</text>
				<text class="fund-text3">{{item.text3}}</text>
			</view>
		</view>
		<!-- 热门基金 -->
		<view class="title"><text>热门基金</text></view>
		<view class="hotFund">
			<view class="options">
				<text v-for="(item,index) in fundOptions" :key="item.id" :class="{selected:index==selected}" @click="selecteds(index)">{{item.text}}</text>
			</view>
			<swiper class="center" :current="selected" @change="centerindex">
				<swiper-item  v-for="(item,index) in fundOptions" :key='item.id'>
					<view class="child" v-for="item in fundDetails" :key="item.id">
						<view class="center-top">
							<text>{{item.title}}</text>
							<text v-if="item.label" class="label">政策利好</text>
						</view>
						<view class="center-bottom">
							<view class="bottom">
								<text class="red">{{item.text1}}</text>
								<text>{{item.text2}}</text>
							</view>
							<view class="bottom">
								<text class="black">{{item.text3}}</text>
								<text>{{item.text4}}</text>
							</view>
							<view class="bottom">
								<text class="black">{{item.text5}}</text>
								<text>{{item.text6}}</text>
							</view>
						</view>
					</view>
				</swiper-item>
			</swiper>
		</view>
		<!-- 占位 -->
		<view class="top">
			<text>财富</text>
			<input type="text" value="" placeholder="搜索相关信息"/>
			<image src="@/static/wealth/4735.png" mode=""></image>
			<image src="@/static/wealth/4736.png" mode=""></image>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				// 导航
				navigation:[
					{id:1,src:'/static/wealth/4718.png',text:'活期'},
					{id:2,src:'/static/wealth/4719.png',text:'定期'},
					{id:3,src:'/static/wealth/4720.png',text:'基金'},
					{id:4,src:'/static/wealth/4721.png',text:'黄金'},
					{id:5,src:'/static/wealth/4722.png',text:'股票'},
					{id:6,src:'/static/wealth/4727.png',text:'稳健精选'},
					{id:7,src:'/static/wealth/4726.png',text:'天天理财'},
					{id:8,src:'/static/wealth/4725.png',text:'基金顾问'},
					{id:9,src:'/static/wealth/4724.png',text:'我的理财'},
					{id:10,src:'/static/wealth/4723.png',text:'高端理财'},
				],
				//行情
				market:[
					{id:1,text:'深圳成指',money:'14828.80',percentage:'-41.86 -0.28%'},
					{id:1,text:'上证指数',money:'14828.80',percentage:'-41.86 -0.28%'},
					{id:1,text:'创业板指',money:'14828.80',percentage:'-41.86 -0.28%'},
				],
				//轮播图
				swiper:[
					{id:1,src:'/static/wealth/51.png'},
					{id:2,src:'/static/wealth/51.png'},
					{id:3,src:'/static/wealth/51.png'},
				],
				//基金
				fund:[
					{id:1,head:'智能投顾',text1:'测一测适合哪种组合',text2:'精心打造 专属方案',text3:'去测评 》'},
					{id:2,head:'追求高收益',text1:'南方股债轮动进取组合',text2:'近一年收益59.15%',text3:'查看详情 》'},
				],
				//热门
				fundOptions:[
					{id:11,text:'推荐'},
					{id:22,text:'稳健之选'},
					{id:33,text:'长跑之选'},
					{id:44,text:'港股精选'},
				],
				selected:0,
				fundDetails:[
					{id:1,title:'广发资源优选A股',label:true,text1:'88.23%',text2:'近一年收益率',
					text3:'前5%',text4:'同类排名',text5:'周期行业',text6:'大宗商品 库存低位'},
					{id:2,title:'南方新悠享混合',label:false,text1:'55.30%',text2:'近一年收益率',
					text3:'前10%',text4:'同类排名',text5:'大国智造' ,text6:'基建制造 转型升级'},
					{id:2,title:'汇添富双利债券A',label:true,text1:'79.36%',text2:'近一年收益率',
					text3:'前10%',text4:'同类排名',text5:'长青板块' ,text6:'白酒+消费内循环'},
				],
				// 页面跳转地址
				gopagepath:['/pages/dueondemand/dueondemand','/pages/particularsHome/particularsHome','/pages/waclthFundChannel/waclthFundChannel','/pages/golds/golds']
			}
		},
		methods: {
			selecteds(index){
				this.selected = index;
			},
			centerindex(event){
				this.selected = event.detail.current
			},
			// 页面跳转
			go(id){
				uni.navigateTo({
					url:this.gopagepath[id-1]
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	// 占位
	.placeholder{
		height: var(--status-bar-height);
		background-color: #3476f1;
	}
	.top{
		height: calc(130rpx + var(--status-bar-height));
		width: 750rpx;
		box-sizing: border-box;
		padding-top: var(--status-bar-height);
		position: fixed;
		top: 0;
		left: 0;
		display: flex;
		justify-content: space-around;
		align-content: center;
		align-items: center;
		flex-wrap: wrap;
		background-color: #3476f1;
		text{
			font-size: 44rpx;
			color: #fff;
			margin-left: 20rpx;
			font-weight: bolder;
		} 
		input{
			font-size: 24rpx;
			color: #ccc;
			background-color: #fff;      
			width: 445rpx;
			height: 60rpx;
			border-radius: 50rpx;
			padding-left: 54rpx;
			box-sizing: border-box;
			background-image: url(@/static/wealth/19.png);
			background-repeat: no-repeat;
			background-size: 24rpx;
			background-position: 16rpx 50%;
		}
		image{
			height: 48rpx;
			width: 48rpx;
			margin-right: 24rpx;
		}	
	}
	// 头部
	.head{
		height: 150rpx;
		width: 750rpx;
		background-color: #3476f1;
		padding-bottom: 40rpx;
		
	}
	// 资产
	.assets{
		background-color: #ffe3c0;
		height: 200rpx;
		width: 750rpx;
		border-radius: 50rpx 0 0 0;
		display: flex;
		justify-content: space-around;
		transform:translateY(-40rpx);
		view{
			text-align: center;
			font-size: 36rpx;
			font-weight: bolder;
			.ass-first{
					display: block;
					margin-top: 35rpx;
					margin-bottom: 24rpx;
					font-size: 24rpx;
					font-weight: normal;
				}
			}
		}
	//导航
	.navigation{
		width: 750rpx;
		height: 340rpx;
		box-sizing: border-box;
		padding: 0 24rpx;
		display: flex;
		flex-wrap: wrap;
		justify-content: space-between;
		background-color: #fff;
		border-radius: 50rpx 0 0 0;
		transform:translateY(-80rpx);
		margin-bottom: -80rpx;
		.navigation-child{
			width: 120rpx;
			text-align: center;
			margin-top: 40rpx;
			image{
				height: 64rpx;
				width: 64rpx;
			}
			text{
				font-size: 24rpx;
				color: #666;
				display: block;
				margin-top: 10rpx;
			}
		}
	}
	// 标题
	.title{
		font-size: 30rpx;
		font-weight: bolder;
		display: flex;
		align-items: center;
		margin: 20rpx 0;
	}
	//标题伪元素
	.title::before{
		content:' ';
		display:block;
		width: 8rpx;
		height: 30rpx;
		border-radius: 6rpx;
		background-color: #3476f1;
		margin-left: 24rpx;
		margin-right: 10rpx;
	}
	//行情
	.market{
		width: 702rpx;
		height: 280rpx;
		margin: 0 auto;
		box-shadow: 0rpx 0rpx 10rpx #f1f1f1;
		box-sizing: border-box;
		padding: 30rpx 24rpx;
		display: flex;
		justify-content: space-between;
		flex-wrap: wrap;
		.market-child{
			text-align: center;
		}
		.market-text1{
			font-size: 28rpx;
			color: #333;
			display: block;
			margin-bottom: 20rpx;
		}
		.market-text2{
			font-size: 36rpx;
			color: #f85656;
			display: block;
			margin-bottom: 10rpx;
		}
		.market-text3{
			font-size: 24rpx;
			color: #f85656;
			display: block;
		}
		.market-bottom{
			margin: 0 auto;
			margin-top: 25rpx;
			height: 58rpx;
			width: 654rpx;
			background-color: #eaf1fe;
			border-radius: 8rpx;
			font-size: 24rpx;
			color: #333;
			display: flex;
			justify-content: space-around;
			align-items: center;
			view{
				display: flex;
				align-items: center;
			}
			.vertical{
				width: 4rpx;
				height: 30rpx;
				background-color: #dbdfe5;
			}
			image{
				height: 25rpx;
				width: 25rpx;
				margin-right: 10rpx;
			}
		}
	}
	//轮播图
	.swiper{
		height: 180rpx;
		width: 702rpx;
		margin: 40rpx auto;
		border-radius: 12rpx;
		overflow: hidden;
		transform-style:preserve-3d;
		image{
			height: 100%;
			width: 100%;
		}
	}
	.fund{
		width: 702rpx;
		margin: 40rpx auto;
		display: flex;
		justify-content: space-between;
		.fund-child{
			width: 340rpx;
			height: 270rpx;
			box-shadow: 0 0 10rpx #f1f1f1;
			box-sizing: border-box;
			padding: 30rpx 24rpx;
			.fund-head{
				padding: 6rpx 10rpx;
				background-color: #eaf1fe;
				font-size: 20rpx;
				color: #3476f1;
			}
			.fund-text1{
				font-size: 28rpx;
				color: #333;
				font-weight: bold;
				margin-top: 22rpx;
				display: block;
			}
			.fund-text2{
				font-size: 24rpx;
				color: #999;
				margin-top: 10rpx;
			}
			.fund-text3{
				font-size: 28rpx;
				color: #333;
				font-weight: bold;
				margin-top: 36rpx;
				display: block;
			}
		}
	}
	.options{
		width: 702rpx;
		display: flex;
		margin: 0 auto;
		box-sizing: border-box;
		padding-right: 120rpx;
		justify-content: space-between;
		font-size: 24rpx;
		color: #999;
		text{
			padding: 5rpx 18rpx;
		}
	}
	.selected{
			background-color: #3476f1;
			color: #fff;
			font-size: 28rpx;
			border-radius: 8rpx;
	}
	.center{
		width: 702rpx;
		height: 660rpx;
		margin: 0 auto;
		margin-top: 40rpx;
		padding: 0 30rpx;
		box-sizing: border-box;
		box-shadow: 0 0 10rpx #f1f1f1;
		border-radius: 15rpx;
		.child{
			padding: 30rpx 0;
			border-bottom: 1rpx solid #f1f1f1;
			.center-top{
				font-size: 28rpx;
				color: #333;
				font-weight: bold;
				display: flex;
				align-items: center;
				.label{
					padding: 5rpx 10rpx;
					margin-left: 10rpx;
					font-size: 20rpx;
					color: #be7f22;
					background-color: #fcf5ec;
				}
			}
			.center-bottom{
				display: flex;
				justify-content: space-between;
				align-items: flex-end;
				margin-top: 20rpx;
				.bottom{
					font-size: 24rpx;
					color: #999;
					display: flex;
					flex-direction: column;
					.red{
						font-size: 44rpx;
						color: #f85656;
						font-weight: bold;
						margin-bottom: 10rpx;
					}
					.black{
						font-size: 36rpx;
						color: #333;
						font-weight: bold;
						margin-bottom: 10rpx;
					}
				}
			}
		}
	}
</style>
